<template>
  <component :is="componentName" :id="rowId" @subPage="subPage"></component>
</template>
<script setup lang="ts" name="accountApproval">
import TableModel from './tableModel.vue'
import DetailModel from '@/views/components/customerDetails/index.vue'

let rowId: undefined | number = undefined
const componentName: Record<string, any> = ref(TableModel)
const pageList = [TableModel, DetailModel]

const subPage = (index, id?) => {
  componentName.value = pageList[index]
  if (index === 1) {
    rowId = id
  }
}
</script>
